//    Copyright (C) Kherty.  All rights reserved.
using System.Windows;
using System.Windows.Controls;

namespace OpenLS.UI
{
    class MenuItemTemplateKey: ResourceKey
    {
        public MenuItemTemplateKey(MenuItemRole role, ControlState state, bool hasCommand)
        {
            _role = role;
            _controlState = state;
            this.hasCommand = hasCommand;
        }
        public override System.Reflection.Assembly Assembly
        {
            get { return GetType().Assembly; }
        }

        readonly bool hasCommand;
        private readonly MenuItemRole _role;
        public MenuItemRole Role
        {
            get { return _role; }
        }
        private readonly ControlState _controlState;
        public ControlState ControlState
        {
            get { return _controlState; }
        }
        public override int GetHashCode()
        {
            return Assembly.GetHashCode() + Role.GetHashCode() + ControlState.GetHashCode()
                + hasCommand.GetHashCode();
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
                return true;
            MenuItemTemplateKey key = obj as MenuItemTemplateKey;
            if (key == null)
                return false;
            return key.Assembly == Assembly && key.ControlState  == ControlState && key.Role == Role
                && key.hasCommand == hasCommand;
        }
       
	
	
    }
}
